unit ueditor;

{$mode objfpc}{$H+}
{Formulario que contiene las pestañas y los editores de texto

  Copyright (C) 2010 Jorge Turiel <contact>

  This source is free software; you can redistribute it and/or modify it under
  the terms of the GNU General Public License as published by the Free
  Software Foundation; either version 2 of the License, or (at your option)
  any later version.

  This code is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  details.

  A copy of the GNU General Public License is available on the World Wide Web
  at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
  to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  MA 02111-1307, USA.
}
interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ComCtrls, SynHighlighterAny;

type

  { TfrEditor }

  TfrEditor = class (TForm )
    Contenedor: TPageControl;
    procedure FormClose (Sender: TObject; var CloseAction: TCloseAction );
    procedure FormCreate (Sender: TObject );
  private

      { private declarations }
  public
    { public declarations }
      //Muestra la pestaña (tabsheet) que tiene el valor pasado como parametro en su propieda tag

   Procedure MuestraTab (idTab: LongInt);
   { Devuelve el contenido de una pestaña pasada como parámetro
  Parametros:
             idTab : Integer; Indica la pestaña buscada
  Retorno:
          TStringList; Cotenido del tab localizado
}

    function ContenidoTab(id: Integer): TStringList;

  end; 

var
  frEditor: TfrEditor;

implementation

{ TfrEditor }
uses uComun,SynMemo,uEditorComun;
Procedure TfrEditor.MuestraTab (idTab: LongInt);
Var
 I : Integer;
Begin
 I := 0;
 While I < Contenedor.PageCount do
 Begin
    If Contenedor.Pages[I].Tag = idTab Then
    Begin
      Contenedor.Pages[I].Show;
      i := Contenedor.PageCount;
    end;
    inc (I);
 end;
end;
procedure TfrEditor.FormCreate (Sender: TObject );
begin
  //Top := LimiteSuperior+30;
  With EditorPos do
  Begin
   Top:= Arriba;
   Left:= Izquierda;
   Width := Ancho;
   Height :=  Alto;
  end;
  nTabSheet := 0;
  NombreSolucion := SinNombre;
  ProyectoActual := '';


end;
function TfrEditor.ContenidoTab(id: Integer): TStringList;
var
  I: Integer;
  Pagina: TPageControl;
  J: Integer;
  Resultado: TStringList;

begin
  Resultado := TStringList.Create;
  Resultado.clear;
  I := 0;
  While I < NumeroDeTabs do
  Begin
    if ContenidoTag (i) = id Then
    Begin
       Resultado := Texto(I);
       ShowMessage (IntToStr (Resultado.Count));
       Result := Resultado;
       Exit;
    end;

    Inc(i);
  end;
  Result := Resultado;
end;


procedure TfrEditor.FormClose (Sender: TObject; var CloseAction: TCloseAction );
begin

end;


initialization
  {$I ueditor.lrs}

end.

